

		//修改案件信息面板
		var mcaseInfoForm;

		//修改案件信息函数
		function modifyCaseInfo(){

		var record = grid.getSelectionModel().getSelected();
        if (!record) {

           Ext.MessageBox.alert('修改操作','请选择要修改的一项！');
        } else {
            caseInfoFunction();

                Ext.getCmp("contractnumber").setValue(record.get("contractnumber"));
            	Ext.getCmp("casesigntime").setValue(record.get("casesigntime"));
            	Ext.getCmp("casetype").setValue(record.get("casetype"));
            	Ext.getCmp("caseproperty").setValue(record.get("caseproperty"));
            	Ext.getCmp("caseconsigner").setValue(record.get("caseconsigner"));
            	Ext.getCmp("identitynumber").setValue(record.get("identitynumber"));
            	Ext.getCmp("phonenumber").setValue(record.get("phonenumber"));
            	Ext.getCmp("oppositeparty").setValue(record.get("oppositeparty"));
            	Ext.getCmp("affaircause").setValue(record.get("affaircause"));
            	Ext.getCmp("casemoney").setValue(record.get("casemoney"));
            	Ext.getCmp("gatherperson").setValue(record.get("gatherperson"));
            	Ext.getCmp("casebill").setValue(record.get("casebill"));
            	Ext.getCmp("archivedeposit").setValue(record.get("archivedeposit"));
                Ext.getCmp("contracttext").setValue(record.get("contracttext"));
                Ext.getCmp("letterauthor").setValue(record.get("letterauthor"));
                Ext.getCmp("courtoffletter").setValue(record.get("courtoffletter"));
                Ext.getCmp("checkoffletter").setValue(record.get("checkoffletter"));
                Ext.getCmp("courtday").setValue(record.get("courtday"));
                Ext.getCmp("introletter").setValue(record.get("introletter"));
                Ext.getCmp("lawyersletter").setValue(record.get("lawyersletter"));
                Ext.getCmp("interviewletter").setValue(record.get("interviewletter"));
                Ext.getCmp("othertext").setValue(record.get("othertext"));
                Ext.getCmp("settlelawsuit").setValue(record.get("settlelawsuit"));
                Ext.getCmp("caseremark").setValue(record.get("caseremark"));
                Ext.getCmp("casepaystatus").setValue(record.get("casepaystatus"));
                Ext.getCmp("undertakelawyer").setValue(record.get("undertakelawyer"));
                Ext.getCmp("caser_roy_money").setValue(record.get("caser_roy_money"));

        }
		}

		//修改案件信息窗口
		var caseInfoFunction = function() {
            caseInfoWindow = new Ext.Window( {
                layout : 'fit',
                width : window.screen.width-600,
                height : 600,
                closeAction : 'hide',
                plain : true,
                title : '修改案件信息窗口',
                items : mcaseInfoForm
            });
        caseInfoWindow.show();
    };

    mcaseInfoForm = new Ext.FormPanel( {
         collapsible : true,// 是否可以展开
        labelWidth : 75, // label settings here cascade unless overridden
        url : 'modifyCaseInfo.jsj',
        frame : true,
        bodyStyle : 'padding:5px 5px 0',
        waitMsgTarget : true,

        defaults : {
            width : 230
        },
        defaultType : 'textfield',
        items : [


        {
            fieldLabel : '合同号',
            itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
            name :'contractnumber',
            readOnly:true,
             id :'contractnumber',
            allowBlank :false
        },
        {
        	xtype:'datefield',
            fieldLabel : '签订时间',
            itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
            name :'casesigntime',
             id :'casesigntime',
            allowBlank :false
        },
        {
                   fieldLabel :'案件类别',
					id :'casetype',
					name :'casetype',
					itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
					 allowBlank :false
        },
        {
            fieldLabel : '案件性质',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'caseproperty',
            id:"caseproperty",
            allowBlank : false
        },
        {
            fieldLabel : '委托人',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'caseconsigner',
            id:"caseconsigner",
            allowBlank : false
        },
        {
            fieldLabel : '身份证号',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'identitynumber',
            id:"identitynumber",
            allowBlank : false
        },
         {
            fieldLabel : '联系方式',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'phonenumber',
            id:"phonenumber",
            allowBlank : false
        },
        {
            fieldLabel : '对方当事人',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'oppositeparty',
            id:"oppositeparty",
            allowBlank : false
        },

        {
            fieldLabel : '事由',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'affaircause',
            id:"affaircause",
            allowBlank : false
        },
         {
            fieldLabel : '合同金额',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'casemoney',
            id:"casemoney",
            allowBlank : false
        },
        {
            fieldLabel : '付款情况',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'casepaystatus',
            id:"casepaystatus",
            allowBlank : false
        },
         {
            fieldLabel : '承办律师',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'undertakelawyer',
            id:"undertakelawyer",
            allowBlank : false
        },
         {
            fieldLabel : '采集人',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'gatherperson',
            id:"gatherperson",
            allowBlank : true
        },
        {
            fieldLabel : '采集人提成金额',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'caser_roy_money',
            id:"caser_roy_money",
            allowBlank : true
        },

         {
            fieldLabel : '票据',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'casebill',
            id:"casebill",
            allowBlank : false
        },
         {
            fieldLabel : '卷宗押金收退情况（0 已收 1 已退）',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'archivedeposit',
            id:"archivedeposit",
            allowBlank : false
        },
        {
            fieldLabel : '合同文本',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'contracttext',
            id:"contracttext",
            allowBlank : false
        },
        {
            fieldLabel : '授权委托书',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'letterauthor',
            id:"letterauthor",
            allowBlank : false
        },
        {
            fieldLabel : '法院公函',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'courtoffletter',
            id:"courtoffletter",
            allowBlank : false
        },
        {
            fieldLabel : '检察院公函',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'checkoffletter',
            id:"checkoffletter",
            allowBlank : false
        },
        {
            fieldLabel : '开庭时间',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'courtday',
            id:"courtday",
            allowBlank : false
        },
        {
            fieldLabel : '介绍信',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'introletter',
            id:"introletter",
            allowBlank : false
        },
        {
            fieldLabel : '律师函',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'lawyersletter',
            id:"lawyersletter",
            allowBlank : false
        },
        {
            fieldLabel : '会见函',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'interviewletter',
            id:"interviewletter",
            allowBlank : false
        },
        {
            fieldLabel : '其他文本',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'othertext',
            id:"othertext",
            allowBlank : false
        },
        {
            fieldLabel : '结案（0 已结案 1 未结案）',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'settlelawsuit',
            id:"settlelawsuit",
            allowBlank : false
        },
		 {
            fieldLabel : '备注',
            itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
            name :'caseremark',
            id:"caseremark",
            allowBlank : false
        }
        ],

        buttons : [ {
            text : '保存',
            disabled : false,
            handler : function() {
                if (mcaseInfoForm.form.isValid()) {
                    mcaseInfoForm.form.submit( {
                        url : 'modifyCaseInfo.jsj',
                        success : function(from, action) {
                         Ext.MessageBox.alert('保存成功', '修改律师信息成功！');
                            store.load( {
                                params : {
                                    start : 0,
                                    limit : 5
                                }
                            });
                            caseInfoWindow.hide();
                        },
                        failure : function(form, action) {
                           Ext.MessageBox.alert('保存失败', '修改律师信息失败！');
                        },
                        waitMsg : '正在保存数据，稍后...'
                    });
                   // dialog.hide();
                } else {
                    Ext.Msg.alert('信息', '请填写完成再提交!');
                }
            }
        }, {
            text : '取消',
            handler : function() {
                caseInfoWindow.hide();
            }
        }]
    });
